package com.alex.core.redis;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Created by S on 2017/5/27.
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Component
public class RedispProperties {
    @Value("${spring.redis.host}")
    private String hostname;
    @Value("${spring.redis.port}")
    private int port;
    @Value("${spring.redis.password}")
    private String password;
    @Value("${spring.redis.lettuce.pool.max-active}")
    private int maxTotal;
    @Value("${spring.redis.lettuce.pool.max-idle}")
    private int maxIdle;
    @Value("${spring.redis.lettuce.pool.min-idle}")
    private int minIdle;
    @Value("${spring.redis.lettuce.pool.maxWaitMillis}")
    private int maxWait;
//    @Value("${redis.testOnBorrow}")
//    private boolean isTestOnBorrow;
//    @Value("${redis.testOnReturn}")
//    private boolean isTestOnReturn;
//    @Value("${redis.testWhileIdle}")
//    private boolean isTestWhileIdle;
//    @Value("${redis.timeBetweenEvictionRunsMillis}")
//    private int timeBetweenEvictionRunsMillis;
//    @Value("${redis.minEvictableIdleTimeMillis}")
//    private int minEvictableIdleTimeMillis;
    @Value("${spring.redis.database}")
    private int dbIndex;

    //集群配置
    private String[] sentinelAddresses;
    private String masterName;



//    @Value("${redis.pool.minIdle}")
//    private int minIdle;
//    @Value("${redis.pool.maxIdle}")
//    private int maxIdle;
//    @Value("${redis.pool.maxTotal}")
//    private int maxTotal;
//    @Value("${redis.timeout}")
//    private int maxWaitMillis = 3000;
//    @Value("${redis.host}")
//    private String host ;
//    @Value("${redis.port}")
//    private  int port;
//    @Value("${redis.password}")
//    private String password ;
//    @Value("${redis.database}")
//    private int database ;
}
